
//
//  TSPraiseDetailController.m
//  chart
//
//  Created by 曾斌 on 16/4/14.
//  Copyright (c) 2016年 xu. All rights reserved.
//

#import "TSPraiseDetailController.h"
#import "TSPraiseEditContentController.h"
#import "TSPraiseTableView.h"
@implementation TSPraiseDetailController

-(UIActionSheet *)createActionSheet
{
    WS(weakSelf);
    UIActionSheet * actionSheet;
    switch (self.detailType) {
        case PraiseDetail_Type_can:
            actionSheet=[[UIActionSheet alloc] initWithTitle:nil delegate:weakSelf cancelButtonTitle:@"取消" destructiveButtonTitle:nil otherButtonTitles:@"查看点赞人列表",@"点赞", nil];
            break;
         case PraiseDetail_Type_already:
             actionSheet=[[UIActionSheet alloc] initWithTitle:nil delegate:weakSelf cancelButtonTitle:@"取消" destructiveButtonTitle:nil otherButtonTitles:@"查看点赞人列表", nil];
            break;
    }
    return actionSheet;
}

#pragma mark - UIActionSheetDelegate
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
    switch (self.detailType) {
        case PraiseDetail_Type_can:
            if (buttonIndex == 0) {
                [self showPraisers];
            }else if (buttonIndex == 1) {
                [self praise];
            }
            break;
            case PraiseDetail_Type_already:
            if (buttonIndex == 0) {
                [self showPraisers];
            }
            break;
    }
    
   
}

-(void)praise{
    TSPraiseEditContentController * edit_col = [[TSPraiseEditContentController alloc] init];
    edit_col.taskId = self.taskModel.tId;
    [self.navigationController pushViewController:edit_col animated:YES];
}

@end
